package com.halflife.comeElectricity.member.rider;

import com.halflife.comeElectricity.basic.datadic.Discount;
import com.halflife.framework.generator.annotation.Join;
import com.halflife.framework.generator.annotation.QueryAnn;
import com.halflife.framework.generator.build.SimpleBuilder;
import com.halflife.framework.generator.build.UpdataBuilder;
import com.halflife.framework.participant.Department;
import org.junit.jupiter.api.Test;

import java.math.BigDecimal;
import java.util.Date;

@QueryAnn(title = "优惠券记录",mainTitle = "优惠券记录",table = "t_DiscountLog")
public class DiscountLog {
    @Test
    public void generate0()throws Exception{
        SimpleBuilder builder = new SimpleBuilder();
        builder.buildAll(this.getClass());
    }
    @Test
    public void generate()throws Exception{
        UpdataBuilder builder = new UpdataBuilder();
        builder.buildMapper(this.getClass());
//        builder.buildAlterTable(this.getClass());
    }
    private Integer id;
    @QueryAnn("骑手Id")
    private Integer riderId;
    @QueryAnn("骑手名称")
    private String riderName;
    @QueryAnn("手机号码")
    private String phone;
    @QueryAnn(value = "是否有效")
    private Boolean valid;
    @QueryAnn("备注")
    private String memo;
    @QueryAnn("充值日期")
    private Long createDate;
    @QueryAnn("开始日期")
    private Long beginDate;
    @QueryAnn("过期日期")
    private Long endDate;
    @QueryAnn("状态")
    private Integer status;
    @QueryAnn("类型")
    private String catagory;
    @QueryAnn("优惠劵金额")
    private BigDecimal discountMoney;
    @QueryAnn("优惠券Id")
    private Integer discountId;
    @QueryAnn(value = "优惠券",refered = true)
    @Join()
    private Discount discount;
    public void init(){
        this.valid=true;
        this.setCreateDate(new Date().getTime());
        this.setStatus(0);
    }
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getRiderId() {
        return riderId;
    }

    public void setRiderId(Integer riderId) {
        this.riderId = riderId;
    }

    public Boolean getValid() {
        return valid;
    }

    public void setValid(Boolean valid) {
        this.valid = valid;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    public Long getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Long createDate) {
        this.createDate = createDate;
    }

    public Long getBeginDate() {
        return beginDate;
    }

    public void setBeginDate(Long beginDate) {
        this.beginDate = beginDate;
    }

    public Long getEndDate() {
        return endDate;
    }

    public void setEndDate(Long endDate) {
        this.endDate = endDate;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getRiderName() {
        return riderName;
    }

    public void setRiderName(String riderName) {
        this.riderName = riderName;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getCatagory() {
        return catagory;
    }

    public void setCatagory(String catagory) {
        this.catagory = catagory;
    }

    public BigDecimal getDiscountMoney() {
        return discountMoney;
    }

    public void setDiscountMoney(BigDecimal discountMoney) {
        this.discountMoney = discountMoney;
    }

    public Integer getDiscountId() {
        return discountId;
    }

    public void setDiscountId(Integer discountId) {
        this.discountId = discountId;
    }

    public Discount getDiscount() {
        return discount;
    }

    public void setDiscount(Discount discount) {
        this.discount = discount;
    }
}